<nav class="navbar navbar-default">
  <div class="container">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="<%= admin_root_path %>">管理平台</a>
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class="nav navbar-nav">
        <li class="active"><a href="<%= admin_root_path %>">Home <span class="sr-only">(current)</span></a></li>
        <li><a href="<%= admin_categories_path %>">分类</a></li>
        <li><a href="<%= admin_products_path %>">商品</a></li>
      </ul>
      <ul class="nav navbar-nav navbar-right">
        <% if logged_in? %>
          <li><a href="#">欢迎你，<%= current_user.username %></a></li>
          <li><%= link_to "退出", logout_path, method: :delete %></li>
          <li><a href="<%= root_path %>">回前台</a></li>
        <% end %>
      </ul>
    </div>
  </div>
</nav>